<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        body {
            margin: 0;
        }

        div {
            height: 100px;
            /*width: calc(25% - 2px);*/
            width: 25%;
            background-color: gold;
            float: left;
            border: 1px solid #000;
            /*border属于宽高*/
            box-sizing: border-box;
        }
    </style>
</head>

<body>

    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>

</body>

</html>